tests: Tweak installed tests to deal with ASAN
authorColin Walters <walters@verbum.org>
Thu, 8 Dec 2016 17:50:20 +0000 (12:50 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 9 Dec 2016 18:05:53 +0000 (18:05 +0000)
We need to disable readdir-rand there too.

Closes: #622
Approved by: jlebon

Makefile-tests.am
tests/libtest.sh

index 11ac2d7fead5411f4ab70cd3fba40e1cccefa0c3..8c37a6e6e6b0a27a142f004b957c135e364ea488 100644 (file)
@@ -116,7 +116,6 @@ endif
 
 dist_installed_test_data = tests/archive-test.sh \
        tests/pull-test.sh \
-       tests/libtest.sh \
        tests/admin-test.sh \
        tests/basic-test.sh \
        tests/test-basic-user.sh \
@@ -125,6 +124,8 @@ dist_installed_test_data = tests/archive-test.sh \
        tests/pre-endian-deltas-repo-little.tar.xz \
        $(NULL)
 
+EXTRA_DIST += tests/libtest.sh 
+
 dist_test_extra_scripts = tests/bootloader-entries-crosscheck.py \
      tests/ostree-grub-generator
 
@@ -286,4 +287,12 @@ install-test-data-file-path-hack:
        fi
        ln -s . $(DESTDIR)$(installed_testdir)/tests
 INSTALL_DATA_HOOKS += install-test-data-file-path-hack
+
+install-libtest:
+if BUILDOPT_ASAN
+       sed -e 's,^BUILT_WITH_ASAN=.*,BUILT_WITH_ASAN=1,' < $(srcdir)/tests/libtest.sh > $(DESTDIR)$(installed_testdir)/tests/libtest.sh
+else
+       install -m 0644 $(srcdir)/tests/libtest.sh $(DESTDIR)$(installed_testdir)/tests/libtest.sh
+endif
+INSTALL_DATA_HOOKS += install-libtest
 endif
index d16aae702ab5f2cf29fb05e4bbae9879ab2ea056..c0bf8d0dbafa71553cb6943adc29ffbcb88d8004 100755 (executable)
@@ -86,13 +86,16 @@ if test -n "${OT_TESTS_DEBUG:-}"; then
     set -x
 fi
 
+# This is substituted by the build for installed tests
+BUILT_WITH_ASAN=""
+
 if test -n "${OT_TESTS_VALGRIND:-}"; then
     CMD_PREFIX="env G_SLICE=always-malloc OSTREE_SUPPRESS_SYNCFS=1 valgrind -q --error-exitcode=1 --leak-check=full --num-callers=30 --suppressions=${test_srcdir}/glib.supp --suppressions=${test_srcdir}/ostree.supp"
 else
     # In some cases the LD_PRELOAD may cause obscure problems,
     # e.g. right now it breaks for me with -fsanitize=address, so
     # let's allow users to skip it.
-    if test -z "${OT_SKIP_READDIR_RAND:-}"; then
+    if test -z "${OT_SKIP_READDIR_RAND:-}" && test -z "${BUILT_WITH_ASAN:-}"; then
        CMD_PREFIX="env LD_PRELOAD=${test_builddir}/libreaddir-rand.so"
     else
        CMD_PREFIX=""